﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Terran
{
	public class ActionHarvestGasSCV : ActionHarvestGas
	{
		public static ActionHarvestGasSCV Instance = new ActionHarvestGasSCV();

		private ActionHarvestGasSCV() { }

		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || (state.Refinery.Total) * 3 <= state.WorkersOnGas;
		}

		private IAction[,] m_Requirements;
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionProduceRefinery.Instance } };
				return m_Requirements;
			}
		}
	}
}
